import org.antlr.runtime.*;
import java.io.*;

public class StringsMain {
    public static void main(String[] args) throws Exception {
        if (args.length != 3) {
            System.err.println("Expected: the source file; the target file; the class name");
            System.exit(1);
        }
        ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(args[0]));
        StringsLexer lexer = new StringsLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        StringsParser parser = new StringsParser(tokens);
        parser.setClassName(args[2]);
        Iterable<String> r = parser.program();

        PrintWriter out = new PrintWriter(args[1]);
        for (String s : r) {
            out.println(s);
        }
        out.close();
    }
}
